package model.purchasing;
// Generated Nov 9, 2012 1:10:43 PM by Hibernate Tools 3.2.1.GA


import java.util.Date;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.IndexColumn;
import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

/**
 * TorderMst generated by hbm2java
 */
@Entity
@Table(name="torder_mst", schema="purchasing")
public class TorderMst  implements java.io.Serializable {
    private long id;
    private Date transDate;
    private Integer addTop;
    private String userId;
    private String notes;
    private List<TorderDetail> torderDetails;

    public TorderMst() {}
    
    @Id 
    @SequenceGenerator(name="order_seq", sequenceName="purchasing.trs_order_mst_id_seq", allocationSize=1)
    @GeneratedValue(strategy= GenerationType.SEQUENCE, generator="order_seq")
    @Column(name="id", unique=true, nullable=false)
    public long getId() {
        return this.id;
    }
    
    public void setId(long id) {
        this.id = id;
    }
    
    @Temporal(TemporalType.DATE)
    @Column(name="trans_date", length=13)
    public Date getTransDate() {
        return this.transDate;
    }
    
    public void setTransDate(Date transDate) {
        this.transDate = transDate;
    }
    
    @Column(name="add_top")
    public Integer getAddTop() {
        return this.addTop;
    }
    
    public void setAddTop(Integer addTop) {
        this.addTop = addTop;
    }
    
    @Column(name="user_id", length=20)
    public String getUserId() {
        return this.userId;
    }
    
    public void setUserId(String userId) {
        this.userId = userId;
    }
    
    @Column(name="notes", length=200)
    public String getNotes() {
        return this.notes;
    }
    
    public void setNotes(String notes) {
        this.notes = notes;
    }
    @OneToMany(cascade=CascadeType.ALL, mappedBy="torderMst")
    @LazyCollection(LazyCollectionOption.FALSE)
    @Cascade(org.hibernate.annotations.CascadeType.DELETE_ORPHAN)
//    @IndexColumn(name="seq", base=1)
    public List<TorderDetail> getTorderDetails() {
        return this.torderDetails;
    }
    
    public void setTorderDetails(List<TorderDetail> torderDetails) {
        this.torderDetails = torderDetails;
    }

}


